package mappedClass;

// Generated 3 juil. 2014 12:40:01 by Hibernate Tools 3.4.0.CR1

import java.util.Date;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Userteamhistory generated by hbm2java
 */
@Entity
@Table(name = "userteamhistory", catalog = "test")
public class UserTeamHistory implements java.io.Serializable {

	private Team team;
	private User user;
	private Date startingTime;
	private Date endingTime;

	public UserTeamHistory() {
	}

	public UserTeamHistory(Team team, User user) {
		this.team = team;
		this.user = user;
	}

	public UserTeamHistory(Team team, User user,
			Date startingTime, Date endingTime) {
		this.team = team;
		this.user = user;
		this.startingTime = startingTime;
		this.endingTime = endingTime;
	}

	@EmbeddedId
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "teamId", nullable = false, insertable = false, updatable = false)
	public Team getTeam() {
		return this.team;
	}

	public void setTeam(Team team) {
		this.team = team;
	}

	@EmbeddedId
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "userId", nullable = false, insertable = false, updatable = false)
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "startingTime", length = 10)
	public Date getStartingTime() {
		return this.startingTime;
	}

	public void setStartingTime(Date startingTime) {
		this.startingTime = startingTime;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "endingTime", length = 10)
	public Date getEndingTime() {
		return this.endingTime;
	}

	public void setEndingTime(Date endingTime) {
		this.endingTime = endingTime;
	}

	@Override
	public String toString() {
		return "UserTeamHistory [team=" + team + ", user="
				+ user + ", startingTime=" + startingTime + ", endingTime="
				+ endingTime;
	}

}
